package cn.itcast.hotel.web;

import cn.itcast.hotel.pojo.HotelDoc;
import cn.itcast.hotel.pojo.RequestParam;
import cn.itcast.hotel.service.IHotelService;
import cn.itcast.hotel.vo.PageResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@Slf4j
@RestController
@RequestMapping("/hotel")
public class HotelController {
    @Autowired
    IHotelService service;

    @RequestMapping("/list")
    public PageResult search(@RequestBody RequestParam param){
       log.warn("controller执行");
        return service.search(param);
    }

    @RequestMapping("/filters")
    public Map<String, List<String>> filters(@RequestBody RequestParam param){
        return service.filters(param);
    }
}
